package com.minglead.crawler.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.minglead.crawler.enums.MacroCollectWayEnum;
import com.minglead.crawler.enums.MacroRepoStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
* 宏观数据 - 指标数据表
* @TableName DC_DATA_MACRO_INDICATOR_DATA
*/
@Data
@TableName("DC_DATA_MACRO_INDICATOR_DATA")
public class DcDataMacroIndicatorDataEntity extends BaseEntity implements Serializable {

    /**
    * 关联到指标表INDICATOR的ID，表示该数据属于哪个指标
    */
    @Schema(description = "关联到指标表INDICATOR的ID，表示该数据属于哪个指标")
    @TableField(value = "INDICATOR_ID", fill = FieldFill.UPDATE)
    private String indicatorId;

    /**
    * 指标的数据值VALUE
    */
    @Schema(description = "指标数据值")
    @TableField(value = "VALUE", fill = FieldFill.UPDATE)
    private Float value;

    /**
     * 数据值单位
     */
    @Schema(description = "单位")
    @TableField(value = "UNIT_TYPE", fill = FieldFill.UPDATE)
    private String unitType;

    /**
    * 数据来源，
    */
    @Schema(description = "数据来源")
    @TableField(value = "DATA_SOURCE", fill = FieldFill.UPDATE)
    private String dataSource;

    /**
    * 数据日期，
    */
    @Schema(description = "数据日期，")
    @TableField(value = "COLLECTION_TIME", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date collectionTime;
    /**
    * 导入时间
    */
    @Schema(description = "导入时间")
    @TableField(value = "IMPORT_TIME", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date importTime;


    /**
    * 入库状态
    */
    @Schema(description = "是否已入库")
    @TableField(value = "REPO_STATUS", fill = FieldFill.UPDATE)
    private MacroRepoStatusEnum repoStatus;

    @Schema(description = "入库人")
    @TableField(value = "REPO_USER_ID", fill = FieldFill.UPDATE)
    private String repoUserId;

    @Schema(description = "入库时间")
    @TableField(value = "REPO_TIME", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date repoTime;
    /**
     * 导入ID
     */
    @Schema(description = "导入ID")
    @TableField(value = "IMPORT_ID", fill = FieldFill.UPDATE)
    private String importId;
    /**
     * 产地品牌
     */
    @Schema(description = "产地品牌")
    @TableField(value = "BRAND", fill = FieldFill.UPDATE)
    private String brand;
    /**
     * 原指标名称
     */
    @Schema(description = "原指标名称")
    @TableField(value = "ORIGINAL_NAME", fill = FieldFill.UPDATE)
    private String originalName;
    /**
     * 指标名称
     */
    @Schema(description = "指标名称")
    @TableField(value = "NAME", fill = FieldFill.UPDATE)
    private String name;

    /**
     * 指标名称
     */
    @Schema(description = "采集方式")
    @TableField(value = "COLLECT_WAY", fill = FieldFill.UPDATE)
    private MacroCollectWayEnum collectWay;

    /**
     * 抓取时间
     */
    @Schema(description = "抓取时间")
    @TableField(value = "GRAB_TIME", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date grabTime;

    /**
     * 数据类型
     */
    @Schema(description = "数据类别")
    @TableField(value = "DATA_CATEGORY", fill = FieldFill.UPDATE)
    private String dataCategory;

    /**
     * 数据地区
     */
    @Schema(description = "数据地区")
    @TableField(value = "AREA_ID", fill = FieldFill.UPDATE)
    private String areaId;

    /**
     * 数据累计日期
     */
    @Schema(description = "数据累计日期")
    @TableField(value = "ACCUMULATE_TIME", fill = FieldFill.UPDATE)
    private String accumulateTime;
    ////////////////////////////非数据库字段//////////////////////////////////////
    @Schema(description = "入库人-中文显示")
    @TableField(exist = false)
    private String repoUserIdValue;

//    @Schema(description = "数据来源-中文显示")
//    @TableField(exist = false)
//    private String dataSourceValue;

    @Schema(description = "是否已入库-中文显示")
    @TableField(exist = false)
    private String repoStatusValue;

}
